package com.scud.common.exception;

import com.scud.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author vermouth
 */
@RestControllerAdvice
public class GlobalExceptionHandler {


    /**
     * 异常处理器
     * @param e:
     * @return Result
     * @author vermouth
     */
    @ResponseBody
    @ExceptionHandler(ScudException.class)
    public Result error(ScudException e){
        e.printStackTrace();
        return Result.error(e.getMessage());
    }
}
